#XLF= ifort -O3 -static -heap-arrays 1024
XLF=gfortran -O3
CXX=g++ -O3 #-fopenmp
test.exe: main.o wrapper.o renorm-modules.o renorm-main.o  renorm-library.o renorm-kk.o renorm-vlowk.o renorm-potentials.o 
	${CXX} -o test.exe  main.o wrapper.o renorm-main.o renorm-modules.o renorm-library.o renorm-kk.o renorm-vlowk.o renorm-potentials.o -lgfortran

main.o: main.cpp
	${CXX} -c main.cpp
#all: wrapper.o renorm-modules.o renorm-main.o  renorm-library.o renorm-kk.o renorm-vlowk.o renorm-potentials.o 


wrapper.o: wrapper.cpp wrapper.h
	${CXX} -c wrapper.cpp


renorm-modules.o :   renorm-modules.f90
		${XLF} -c  renorm-modules.f90

renorm-main.o :   renorm-main.f90
		${XLF} -c renorm-main.f90

#renorm-gmatrix.o :   renorm-gmatrix.f90
#		${XLF} -c   renorm-gmatrix.f90

#renorm-nocore.o :   renorm-nocore.f90
#		${XLF} -c   renorm-nocore.f90

renorm-vlowk.o :   renorm-vlowk.f90
		${XLF} -c   renorm-vlowk.f90
renorm-kk.o :   renorm-kk.f90
		${XLF} -c   renorm-kk.f90
#renorm-vkrg.o :   renorm-vkrg.f90
#		${XLF} -c   renorm-vkrg.f90

renorm-potentials.o :   renorm-potentials.f
		${XLF} -c    renorm-potentials.f



renorm-library.o :   renorm-library.f
		${XLF} -c    renorm-library.f
.PHONY: clean
clean:
	rm -rf *.mod *.o test.exe
